<?php
$search=$_POST['txtsearch'];
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td style="padding:10px">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td class="bg_title"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><img src="images/icon-48-menumgr.png" width="48" height="48" /></td>
                <td width="45%" class="mana_title">Danh sách yêu cầu mới gửi</td>
                <td width="50%" align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                   
                  </table>
                  </td>
              </tr>
            </table></td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="7"></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td bgcolor="#fbfbfb"><form id="frmdanhsach" name="frmdanhsach" method="post" action="">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><input type="text" name="txtsearch" id="txtsearch" value="<?=$search?>" />
                    <input type="submit" name="button" id="button" value="Tìm kiếm" /></td>
                </tr>
                <tr>
                  <td style="padding:7px"><table width="100%" border="1" cellspacing="0" cellpadding="0" class="list_border">
                    <tr>
                      <td width="5%" class="list_title">Mã số</td>
                      <td width="7%" class="list_title">Mã KH</td>
                      <td width="20%" class="list_title">Tên KH</td>
                      <td width="20%" class="list_title">Lĩnh vực</td>
                      <td width="10%" class="list_title">Gửi đến</td>
                     
                      <td width="10%" class="list_title">Thời gian</td>
                       <td width="10%" class="list_title">Dịch vụ</td>
                    </tr>
                    <? 
					
					
	$sqlstring="select * from 
							tb_services
							inner join tb_services_type
							on tb_services.services_type_id = tb_services_type.services_type_id
							inner join tb_account
							on tb_services.account_code = tb_account.account_code
							 ";
	if($search!=""){$sqlstring.=" and services_name like '%$search%'";}
	$qr12=mysql_query($sqlstring);
	$n_record=mysql_num_rows($qr12); 
	$p=$_SESSION['page'];
	$n=$_GET['n'];
	include 'phantrang.php';
	$sqlstring.=" order by services_id desc";
	if ($n!='all'){$sqlstring.=" limit $s,$p";}
	$qr1=mysql_query($sqlstring); 
	$i=0;
	while($row=mysql_fetch_array($qr1)) 
	{ $i=$i+1;
	
	
  ?>
                    <tr  onmouseover="this.bgColor='#ffffdd'" onmouseout="this.bgColor=''" >
                      <td align="center" style="height:30"><?=$i?></td>
                      
                      <td class="link-edit"><a href="index.php?progid=6&services=sua&id=<?=$row['services_id']?>"><?=$row['services_name']?></a></td>
                      <td align="left" style="padding-left:5px; line-height:18px"><?php echo $row['services_type_name'];?> </td>
                      <td align="center" style="padding-left:5px; padding-right:5px; line-height:18px;"><?php echo $row['account_code'];?> <br /> (<?php echo $row['account_name'];?>) </td>
                      <td align="center"><?php if($row['services_status']==1){?><img src="images/tick.png" /><? }else{?><img src="images/publish_x.png" /><? }?></td>
                      
                      <td align="center"><?php echo $row['services_id']?></td>
                      <td> </td>
                    </tr>
<? }?>
                  </table></td>
                </tr>
                <tr>
                  <td><? view_page('index.php?progid=6'); ?></td>
                </tr>
              </table>
              <input type="hidden" name="count" id="count" value="<?=$i?>"  />
                        </form>
            </td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</td>
  </tr>
</table>
